package astStatData;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.eclipse.jdt.core.dom.ASTNode;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.core.dom.IBinding;

public class ElementMap {
	
	//	CUs: Store CompileUnits related with this 
	private Set<ASTNode> CUs = null;
//	private Map<String, JElement> elemMap = null;
	
	//	(String)key  (ASTNode) 
	private Map<String, ASTNode> nodeMap = null;
	
	public ElementMap(){
		nodeMap = new HashMap<String, ASTNode>(); 
		CUs = new HashSet<ASTNode>();
	}
	
	public void put(String key, ASTNode node) {
		nodeMap.put(key, node);
		
	}
	
	public ASTNode get(String key){
		return nodeMap.get(key);
	}
	
	public Set<String> getKeys(){
		return nodeMap.keySet();
	}
	public void addCU(CompilationUnit cu){
		CUs.add(cu);
	}
	
	public HashSet<ASTNode> getCUs(){
		return (HashSet<ASTNode>) CUs;	
	}

	public HashMap<String, ASTNode> getNodeMap(){
		return (HashMap<String, ASTNode>) nodeMap ;	
	}
}
